/*
 * CFJ-3000 - Phone system.
 *
 * (c) 2007 Cleiber Marques
 * (c) 2007 Filipe Medeiros
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 *
 */

#include "cfj.h"

/* Function: ring */
int ring()
{
  int ringfd, i;
  if ((ringfd = open(RING_DEV, O_NOCTTY)) == 1 )
  {
    perror("Can not open ring device!\n"); 
    return FALSE;
  }
  for (i=0; i<10; i++){
    ioctl(ringfd, KDMKTONE, (250<<16)+500);
    usleep(20000);
    ioctl(ringfd, KDMKTONE, (250<<16)+700);
    usleep(20000);
    ioctl(ringfd, KDMKTONE, (250<<14)+900);
    usleep(20000);
  }
  close(ringfd);
  usleep(750000);
  return TRUE;
} 
